var loaded = 0;
(function() {

	$J('body').on('click', '.cfmBtn', function() {
		var p = $J(this).parent();
		var selName = p.find('.selName').val();
		var inputName = p.find('.oninputsearch').val();
		if (selName == inputName) {
			p.find('.cfmValue').val(selName);
			p.find('.cfmId').val(p.find('.selId').val());
		} else {
			p.find('.cfmValue').val('');
			p.find('.cfmId').val('');
		}
	});
	$J('.oninputsearch').attr("autocomplete", "off");
	$J('#selParent').autocomplete({
		serviceUrl : window.baseUrl + '/user/merchant/query',
		onSelect : function(suggestion) {
			if ($J('#selParentId').length > 0) {
				$J('#selParentId').val(suggestion.id);
				$J('#selParentName').val(suggestion.name);
			}
		}
	});
	


	// orgValidator.init();
})();
